import {
	defineConfig
} from "vite"
import uni from "@dcloudio/vite-plugin-uni";

export default defineConfig({
	plugins: [
		uni()
	],
	server: {
		port: 3033,
		proxy: {
			'/device': {
				target: 'http://218.58.79.146:17081',
				changeOrigin: true,
				rewrite: path => {
					return path.replace(/^\/device/, '')
				}
			},
			'/app': {
				target: 'http://60.209.108.66:19000',
				// target: 'http://172.17.204.4:19000',
				changeOrigin: true,
				rewrite: path => {
					return path.replace(/^\/app/, '')
				}
			},
			'/hz-admin': {
				target: 'http://120.221.95.112:18083',
				changeOrigin: true,
			},
			// '/app': {
			// 	target: 'http://218.58.79.146:8181',
			// 	//target: 'http://60.209.108.66:19000',
			// 	// target: 'http://172.17.204.4:19000',
			// 	changeOrigin: true,
			// 	rewrite: path => {
			// 		return path.replace(/^\/app/, '')
			// 	}
			// },
			'/dingtalk': {
				target: 'https://oapi.dingtalk.com',
				changeOrigin: true,
				rewrite: path => {
					return path.replace(/^\/dingtalk/, '')
				}
			},
			'/sdt': {
				target: 'https://oapi.dingtalk.com',
				changeOrigin: true,
				rewrite: path => {
					return path.replace(/^\/sdt/, '')
				}
			},
			'/qdgov': {
				target: 'http://172.17.204.1:9000',
				changeOrigin: true,
				rewrite: path => {
					return path.replace(/^\/qdgov/, 'qdgov')
				}
			},
		}
	}
})